package com.mrdeer.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mrdeer.user.api.entity.AccountRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 账号-角色关系 Mapper 接口
 *
 * @author ：xie jianchu
 * @date ：Created in 2020/9/7 0007 17:59
 */
@Repository
public interface AccountRoleMapper extends BaseMapper<AccountRole> {

    void deleteByUsernameInTenant(@Param("tenantId") Long tenantId, @Param("username") String username);

    List<Long> selectRoleByUsernameInTenants(@Param("username") String username, @Param("ids") List<Long> ids);

    void insertAccountRole(@Param("username") String username, @Param("tenantId") Long tenantId, @Param("roleList") List<String> roleList);
}
